package com.geekaca.d4.d1_date;

import java.util.Date;

public class HelloDate {
    public static void main(String[] args) {
//        System.out.println(date);

        // 获取对应的时间亳秒数,时间戳, 1970-1-1 0.0.0~当前的亳秒数
        long l = System.currentTimeMillis();
        System.out.println("timeStamp: " + l);

        Date date = new Date();
        long time = date.getTime();
        System.out.println("time: " + time);

        long curTime = System.currentTimeMillis();
        curTime += 60 * 60 * 1000;
        System.out.println("一小时后的时间戳: " + curTime);

        // 把亳秒值转换为时间
        date.setTime(curTime);
        System.out.println(date);

    }
}
